package com.wonderful.wedding.repository;

import com.google.common.base.Optional;
import com.wonderful.wedding.mapper.PersonMapper;
import com.wonderful.wedding.model.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


@Repository
public class PersonRepository {

    @Autowired
    private PersonMapper mapper;

    public Optional<Person> findPersonByName(String name) {
        return Optional.fromNullable(mapper.findByName(name));
    }

    public void create(Person person) {
        mapper.create(person);
    }
}
